package cn.lili.modules.member.entity.dos;

import cn.lili.common.utils.BeanUtil;
import cn.lili.common.utils.SnowFlake;
import cn.lili.modules.member.entity.dto.UnionAddDTO;
import cn.lili.modules.member.entity.dto.UserInfoDTO;
import cn.lili.mybatis.model.BaseSceneEntity;
import cn.lili.mybatis.model.BaseStandardEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("li_union")
@ApiModel(value = "工会")
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class Union extends BaseStandardEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "工会名称")
    private String unionName;
    @ApiModelProperty(value = "工会所属省份ID")
    private String provinceId;
    @ApiModelProperty(value = "工会所属省份名称")
    private String provinceName;
    @ApiModelProperty(value = "工会所属城市ID")
    private String cityId;
    @ApiModelProperty(value = "工会所属城市名称")
    private String cityName;
    @ApiModelProperty(value = "工会会长ID")
    private String chairmanId;
    @ApiModelProperty(value = "工会会长名称")
    private String chairmanName;
    @ApiModelProperty(value = "首任工会会长ID")
    private String firstChairmanId;
    @ApiModelProperty(value = "首任工会会长名称")
    private String firstChairmanName;

    @ApiModelProperty(value = "成员数量")
    @TableField(exist = false)
    private Long memberCount = 0L;

    @ApiModelProperty(value = "本月经费")
    @TableField(exist = false)
    private Double currentMonthMoney = 0D;

    @ApiModelProperty(value = "工会会长头像")
    @TableField(exist = false)
    private String chairmanPortrait;

    @ApiModelProperty(value = "群组ID")
    private String groupId;

    @ApiModelProperty(value = "运营中心名称")
    @TableField(exist = false)
    private String operationCenterName;

    public Union(UnionAddDTO unionAddDTO) {
        BeanUtil.copyProperties(unionAddDTO, this);
        this.setId(SnowFlake.getIdStr());
    }
}
